package com.hehui.partimejob.network;

import com.hehui.partimejob.service.vo.ServiceDataVo;
import com.hehui.partimejob.service.vo.ServiceListDataVo;

import java.lang.reflect.ParameterizedType;

public abstract class OnNetworkListener<T> implements OnNetworkListenerI<T> {
    protected Class<T> clazz;

//    通过反射 将T转成Class
    public Class<T> getType() {
       return clazz=(Class<T>)((ParameterizedType)getClass().getGenericSuperclass()).getActualTypeArguments()[0];
    }

    @Override
    public void handleData(ServiceDataVo<T> data) {

    } @Override
    public void handleListData(ServiceListDataVo<T> data) {

    }
}
